function GuiContainerPurchase() {
  
};

GuiContainerPurchase.instance = function(prefix, sample, item) {
  var gui = { sample: document.getElementById(prefix + '_sample_select'),
              product: document.getElementById(prefix + '_product_td'),
              quantity: document.getElementById(prefix + '_quantity_text'),
              price: document.getElementById(prefix + '_price_text'),
              gst: document.getElementById(prefix + '_gst_div'),
              attributes: [],
              design: document.getElementById(prefix + '_design_div')
            };
  if (sample) {
    for (var i = 0, il = sample.attributes.length; i < il; i++) {
      gui.attributes[gui.attributes.length] = GuiContainerPurchase._attribute(prefix + '_' + i, sample.attributes[i]);
    }
  } else {
    for (var i = 0, il = item.selects.length; i < il; i++) {
      gui.attributes[gui.attributes.length] = GuiContainerPurchase._attribute1(prefix + '_' + i);
    }
  }
  return gui;
};

GuiContainerPurchase._attribute = function(prefix, sampleAttribute) {
  var gui = { name: document.getElementById(prefix + '_name_div'),
              options: []
            };
  for (var i = 0, il = sampleAttribute.options.length; i < il; i++) {
    gui.options[gui.options.length] = GuiContainerPurchase._option(prefix + '_' + i);
  }
  return gui;
};

GuiContainerPurchase._attribute1 = function(prefix) {
  var gui = { name: document.getElementById(prefix + '_name_div'),
              option: document.getElementById(prefix + '_name1_div')
            };
  return gui;
};

GuiContainerPurchase._option = function(prefix) {
  return { name: document.getElementById(prefix + '_name_div') };
};